
import Vue from 'vue'
import Vuex from 'vuex'

import {setItem, getItem} from '@/utils/storeage'
Vue.use(Vuex)

const TOKEN_KEY='toutiao_token'

export default new Vuex.Store({
  state: {
    user:getItem(TOKEN_KEY) || []
  },
  mutations: {
    setUser(state,payload){
      state.user= payload
      setItem(TOKEN_KEY,payload)
    }
  },
  actions: {
  },
  modules: {
  }
})
